package com.A21.GuoSai.demo.atom_adjust.service.impl;

import com.A21.GuoSai.demo.atom_adjust.mapper.AtomServiceMapper;
import com.A21.GuoSai.demo.atom_adjust.service.AtomPojoService;
import com.A21.GuoSai.demo.service_entity.entity.atom.AtomServicePojo;
import com.A21.GuoSai.demo.service_entity.entity.atom.DynamicVarPojo;
import com.A21.GuoSai.demo.service_entity.entity.atom.StaticVarPojo;
import com.A21.GuoSai.demo.service_entity.entity.workflow.DynamicVarValuePojo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class AtomPojoServiceImpl implements AtomPojoService {

    @Autowired
    AtomServiceMapper atomServiceMapper;

    @Override
    public List<AtomServicePojo> getAllAtoms(){
        return atomServiceMapper.getAllAtomServices();
    }

    @Override
    public List<AtomServicePojo> getAllAtomMessages() {
        return atomServiceMapper.getAllAtomServiceStaVarMessages();
    }

    @Override
    public Integer getAtomIdByName(String atomName) {
        return atomServiceMapper.getAtomIdByName(atomName);
    }

    @Override
    public StaticVarPojo getStaticVarByName(String atomName,String s_name) {
        return atomServiceMapper.getStaticVarByName(atomName,s_name);
    }

    @Override
    public List<StaticVarPojo> getAtomStaticVar(AtomServicePojo atomService) {
        return atomServiceMapper.getAtomStaticVar(atomService);
    }

    @Override
    public List<DynamicVarPojo> getAtomDynamicVar(AtomServicePojo atomService) {
        return atomServiceMapper.getAtomDynamicVar(atomService);
    }

    @Override
    public List<DynamicVarValuePojo> getAtomDynamicVarByAtomIds(List<Integer> atomIds) {
        return atomServiceMapper.getAtomDynamicVarByAtomIds(atomIds);
    }

    @Override
    public void insertAtomService(AtomServicePojo atomService) {
        atomServiceMapper.insertAtomService(atomService);
    }

    @Override
    public void insertAtomStaticVar(StaticVarPojo staticVarPojo) {
        atomServiceMapper.insertAtomStaticVar(staticVarPojo);
    }

    @Override
    public void insertAtomDynamicVar(DynamicVarPojo dynamicVarPojo) {
        atomServiceMapper.insertAtomDynamicVar(dynamicVarPojo);
    }

    @Override
    public void updateAtom_Author_Attr(String author, String attributeConnnect, Integer id) {
        atomServiceMapper.updateAtom_Author_Attr(author, attributeConnnect, id);
    }
}
